3.119 \(\int \frac{c+d x}{a-a \sin (e+f x)} \, dx\)

Optimal. Leaf size=59 \[ \frac{(c+d x) \tan \left (\frac{e}{2}+\frac{f x}{2}+\frac{\pi }{4}\right )}{a f}+\frac{2 d \log \left (\cos \left (\frac{e}{2}+\frac{f x}{2}+\frac{\pi }{4}\right )\right )}{a f^2} \]

[Out]

(2*d*Log[Cos[e/2 + Pi/4 + (f*x)/2]])/(a*f^2) + ((c + d*x)*Tan[e/2 + Pi/4 + (f*x)/2])/(a*f)

________________________________________________________________________________________

Rubi [A]  time = 0.06638, antiderivative size = 59, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.158, Rules used = {3318, 4184, 3475} \[ \frac{(c+d x) \tan \left (\frac{e}{2}+\frac{f x}{2}+\frac{\pi }{4}\right )}{a f}+\frac{2 d \log \left (\cos \left (\frac{e}{2}+\frac{f x}{2}+\frac{\pi }{4}\right )\right )}{a f^2} \]

Antiderivative was successfully verified.

[In]

Int[(c + d*x)/(a - a*Sin[e + f*x]),x]

[Out]

(2*d*Log[Cos[e/2 + Pi/4 + (f*x)/2]])/(a*f^2) + ((c + d*x)*Tan[e/2 + Pi/4 + (f*x)/2])/(a*f)

Rule 3318

Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(2*a)^n, Int[(c
 + d*x)^m*Sin[(1*(e + (Pi*a)/(2*b)))/2 + (f*x)/2]^(2*n), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && EqQ[a^2
- b^2, 0] && IntegerQ[n] && (GtQ[n, 0] || IGtQ[m, 0])

Rule 4184

Int[csc[(e_.) + (f_.)*(x_)]^2*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> -Simp[((c + d*x)^m*Cot[e + f*x])/f, x]
+ Dist[(d*m)/f, Int[(c + d*x)^(m - 1)*Cot[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \frac{c+d x}{a-a \sin (e+f x)} \, dx &=\frac{\int (c+d x) \csc ^2\left (\frac{1}{2} \left (e-\frac{\pi }{2}\right )+\frac{f x}{2}\right ) \, dx}{2 a}\\ &=\frac{(c+d x) \tan \left (\frac{e}{2}+\frac{\pi }{4}+\frac{f x}{2}\right )}{a f}+\frac{d \int \cot \left (\frac{e}{2}-\frac{\pi }{4}+\frac{f x}{2}\right ) \, dx}{a f}\\ &=\frac{2 d \log \left (\cos \left (\frac{e}{2}+\frac{\pi }{4}+\frac{f x}{2}\right )\right )}{a f^2}+\frac{(c+d x) \tan \left (\frac{e}{2}+\frac{\pi }{4}+\frac{f x}{2}\right )}{a f}\\ \end{align*}

Mathematica [A]  time = 0.150707, size = 47, normalized size = 0.8 \[ \frac{f (c+d x) \tan \left (\frac{1}{4} (2 e+2 f x+\pi )\right )+2 d \log \left (\cos \left (\frac{1}{4} (2 e+2 f x+\pi )\right )\right )}{a f^2} \]

Antiderivative was successfully verified.

[In]

Integrate[(c + d*x)/(a - a*Sin[e + f*x]),x]

[Out]

(2*d*Log[Cos[(2*e + Pi + 2*f*x)/4]] + f*(c + d*x)*Tan[(2*e + Pi + 2*f*x)/4])/(a*f^2)

________________________________________________________________________________________

Maple [B]  time = 0.06, size = 123, normalized size = 2.1 \begin{align*} -2\,{\frac{c}{af \left ( \tan \left ( 1/2\,fx+e/2 \right ) -1 \right ) }}-{\frac{dx}{af} \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) -1 \right ) ^{-1}}-{\frac{dx}{af}\tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) -1 \right ) ^{-1}}-{\frac{d}{a{f}^{2}}\ln \left ( 1+ \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) \right ) ^{2} \right ) }+2\,{\frac{d\ln \left ( \tan \left ( 1/2\,fx+e/2 \right ) -1 \right ) }{a{f}^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*x+c)/(a-a*sin(f*x+e)),x)

[Out]

-2/a*c/f/(tan(1/2*f*x+1/2*e)-1)-1/a*d/(tan(1/2*f*x+1/2*e)-1)*x/f-1/a*d/(tan(1/2*f*x+1/2*e)-1)*x/f*tan(1/2*f*x+
1/2*e)-1/a*d/f^2*ln(1+tan(1/2*f*x+1/2*e)^2)+2/a*d/f^2*ln(tan(1/2*f*x+1/2*e)-1)

________________________________________________________________________________________

Maxima [B]  time = 1.00975, size = 228, normalized size = 3.86 \begin{align*} \frac{\frac{{\left (2 \,{\left (f x + e\right )} \cos \left (f x + e\right ) +{\left (\cos \left (f x + e\right )^{2} + \sin \left (f x + e\right )^{2} - 2 \, \sin \left (f x + e\right ) + 1\right )} \log \left (\cos \left (f x + e\right )^{2} + \sin \left (f x + e\right )^{2} - 2 \, \sin \left (f x + e\right ) + 1\right )\right )} d}{a f \cos \left (f x + e\right )^{2} + a f \sin \left (f x + e\right )^{2} - 2 \, a f \sin \left (f x + e\right ) + a f} - \frac{2 \, d e}{a f - \frac{a f \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}} + \frac{2 \, c}{a - \frac{a \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}}}{f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)/(a-a*sin(f*x+e)),x, algorithm="maxima")

[Out]

((2*(f*x + e)*cos(f*x + e) + (cos(f*x + e)^2 + sin(f*x + e)^2 - 2*sin(f*x + e) + 1)*log(cos(f*x + e)^2 + sin(f
*x + e)^2 - 2*sin(f*x + e) + 1))*d/(a*f*cos(f*x + e)^2 + a*f*sin(f*x + e)^2 - 2*a*f*sin(f*x + e) + a*f) - 2*d*
e/(a*f - a*f*sin(f*x + e)/(cos(f*x + e) + 1)) + 2*c/(a - a*sin(f*x + e)/(cos(f*x + e) + 1)))/f

________________________________________________________________________________________

Fricas [B]  time = 1.632, size = 251, normalized size = 4.25 \begin{align*} \frac{d f x + c f +{\left (d f x + c f\right )} \cos \left (f x + e\right ) +{\left (d \cos \left (f x + e\right ) - d \sin \left (f x + e\right ) + d\right )} \log \left (-\sin \left (f x + e\right ) + 1\right ) +{\left (d f x + c f\right )} \sin \left (f x + e\right )}{a f^{2} \cos \left (f x + e\right ) - a f^{2} \sin \left (f x + e\right ) + a f^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)/(a-a*sin(f*x+e)),x, algorithm="fricas")

[Out]

(d*f*x + c*f + (d*f*x + c*f)*cos(f*x + e) + (d*cos(f*x + e) - d*sin(f*x + e) + d)*log(-sin(f*x + e) + 1) + (d*
f*x + c*f)*sin(f*x + e))/(a*f^2*cos(f*x + e) - a*f^2*sin(f*x + e) + a*f^2)

________________________________________________________________________________________

Sympy [A]  time = 1.10533, size = 272, normalized size = 4.61 \begin{align*} \begin{cases} - \frac{2 c f}{a f^{2} \tan{\left (\frac{e}{2} + \frac{f x}{2} \right )} - a f^{2}} - \frac{d f x \tan{\left (\frac{e}{2} + \frac{f x}{2} \right )}}{a f^{2} \tan{\left (\frac{e}{2} + \frac{f x}{2} \right )} - a f^{2}} - \frac{d f x}{a f^{2} \tan{\left (\frac{e}{2} + \frac{f x}{2} \right )} - a f^{2}} + \frac{2 d \log{\left (\tan{\left (\frac{e}{2} + \frac{f x}{2} \right )} - 1 \right )} \tan{\left (\frac{e}{2} + \frac{f x}{2} \right )}}{a f^{2} \tan{\left (\frac{e}{2} + \frac{f x}{2} \right )} - a f^{2}} - \frac{2 d \log{\left (\tan{\left (\frac{e}{2} + \frac{f x}{2} \right )} - 1 \right )}}{a f^{2} \tan{\left (\frac{e}{2} + \frac{f x}{2} \right )} - a f^{2}} - \frac{d \log{\left (\tan ^{2}{\left (\frac{e}{2} + \frac{f x}{2} \right )} + 1 \right )} \tan{\left (\frac{e}{2} + \frac{f x}{2} \right )}}{a f^{2} \tan{\left (\frac{e}{2} + \frac{f x}{2} \right )} - a f^{2}} + \frac{d \log{\left (\tan ^{2}{\left (\frac{e}{2} + \frac{f x}{2} \right )} + 1 \right )}}{a f^{2} \tan{\left (\frac{e}{2} + \frac{f x}{2} \right )} - a f^{2}} & \text{for}\: f \neq 0 \\\frac{c x + \frac{d x^{2}}{2}}{- a \sin{\left (e \right )} + a} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)/(a-a*sin(f*x+e)),x)

[Out]

Piecewise((-2*c*f/(a*f**2*tan(e/2 + f*x/2) - a*f**2) - d*f*x*tan(e/2 + f*x/2)/(a*f**2*tan(e/2 + f*x/2) - a*f**
2) - d*f*x/(a*f**2*tan(e/2 + f*x/2) - a*f**2) + 2*d*log(tan(e/2 + f*x/2) - 1)*tan(e/2 + f*x/2)/(a*f**2*tan(e/2
 + f*x/2) - a*f**2) - 2*d*log(tan(e/2 + f*x/2) - 1)/(a*f**2*tan(e/2 + f*x/2) - a*f**2) - d*log(tan(e/2 + f*x/2
)**2 + 1)*tan(e/2 + f*x/2)/(a*f**2*tan(e/2 + f*x/2) - a*f**2) + d*log(tan(e/2 + f*x/2)**2 + 1)/(a*f**2*tan(e/2
 + f*x/2) - a*f**2), Ne(f, 0)), ((c*x + d*x**2/2)/(-a*sin(e) + a), True))

________________________________________________________________________________________

Giac [B]  time = 1.28914, size = 941, normalized size = 15.95 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)/(a-a*sin(f*x+e)),x, algorithm="giac")

[Out]

(d*f*x*tan(1/2*f*x)*tan(1/2*e) - d*f*x*tan(1/2*f*x) - d*f*x*tan(1/2*e) + c*f*tan(1/2*f*x)*tan(1/2*e) + d*log(2
*(tan(1/2*e)^2 + 1)/(tan(1/2*f*x)^4*tan(1/2*e)^2 + 2*tan(1/2*f*x)^4*tan(1/2*e) + 2*tan(1/2*f*x)^3*tan(1/2*e)^2
 + tan(1/2*f*x)^4 + 2*tan(1/2*f*x)^2*tan(1/2*e)^2 - 2*tan(1/2*f*x)^3 + 2*tan(1/2*f*x)*tan(1/2*e)^2 + 2*tan(1/2
*f*x)^2 + tan(1/2*e)^2 - 2*tan(1/2*f*x) - 2*tan(1/2*e) + 1))*tan(1/2*f*x)*tan(1/2*e) - d*f*x - c*f*tan(1/2*f*x
) + d*log(2*(tan(1/2*e)^2 + 1)/(tan(1/2*f*x)^4*tan(1/2*e)^2 + 2*tan(1/2*f*x)^4*tan(1/2*e) + 2*tan(1/2*f*x)^3*t
an(1/2*e)^2 + tan(1/2*f*x)^4 + 2*tan(1/2*f*x)^2*tan(1/2*e)^2 - 2*tan(1/2*f*x)^3 + 2*tan(1/2*f*x)*tan(1/2*e)^2
+ 2*tan(1/2*f*x)^2 + tan(1/2*e)^2 - 2*tan(1/2*f*x) - 2*tan(1/2*e) + 1))*tan(1/2*f*x) - c*f*tan(1/2*e) + d*log(
2*(tan(1/2*e)^2 + 1)/(tan(1/2*f*x)^4*tan(1/2*e)^2 + 2*tan(1/2*f*x)^4*tan(1/2*e) + 2*tan(1/2*f*x)^3*tan(1/2*e)^
2 + tan(1/2*f*x)^4 + 2*tan(1/2*f*x)^2*tan(1/2*e)^2 - 2*tan(1/2*f*x)^3 + 2*tan(1/2*f*x)*tan(1/2*e)^2 + 2*tan(1/
2*f*x)^2 + tan(1/2*e)^2 - 2*tan(1/2*f*x) - 2*tan(1/2*e) + 1))*tan(1/2*e) - c*f - d*log(2*(tan(1/2*e)^2 + 1)/(t
an(1/2*f*x)^4*tan(1/2*e)^2 + 2*tan(1/2*f*x)^4*tan(1/2*e) + 2*tan(1/2*f*x)^3*tan(1/2*e)^2 + tan(1/2*f*x)^4 + 2*
tan(1/2*f*x)^2*tan(1/2*e)^2 - 2*tan(1/2*f*x)^3 + 2*tan(1/2*f*x)*tan(1/2*e)^2 + 2*tan(1/2*f*x)^2 + tan(1/2*e)^2
 - 2*tan(1/2*f*x) - 2*tan(1/2*e) + 1)))/(a*f^2*tan(1/2*f*x)*tan(1/2*e) + a*f^2*tan(1/2*f*x) + a*f^2*tan(1/2*e)
 - a*f^2)